package com.xintouyun.medicine.service.impl;

import java.util.List;

import com.xintoucloud.jdbcutil.JdbcUtil;
import com.xintouyun.medicine.dao.NewsDao;
import com.xintouyun.medicine.entity.News;
import com.xintouyun.medicine.service.NewsService;

public class NewsServiceImpl implements NewsService{
    
	NewsDao newsDao = new NewsDao();
	@Override
	public List<News> showNews(int state) {
		try {
			List<News> showNews = newsDao.list("select * from m_news where state=?",state);
			return showNews;
		} finally {
			JdbcUtil.closeConnection();
		}
	}
	@Override
	public News get(Integer nid) {
		try {
			News theNews = newsDao.get(nid);
			return theNews;
		} finally{
			JdbcUtil.closeConnection();
		}
	}

}
